package xdom

import (
//	"w3c/dom"
)

const (
	INITIAL_DOMSTRINGLIST_CAPACITY = 16
)

// dom.DOMException
type DOMException struct {
	code uint16
}

func (de *DOMException) Code() uint16 {
	return de.code
}

type DOMStringList []string // Implements dom.DOMStringList

func NewDOMStringList() DOMStringList {
	return DOMStringList(make([]string, 0, INITIAL_DOMSTRINGLIST_CAPACITY))
}
func (list DOMStringList) Item(index uint64) string {
	return list[index]
}
func (list DOMStringList) Length() uint64 {
	return uint64(len(list))
}
func (list DOMStringList) Contains(str string) bool {
	for _, s := range list {
		if str == s {
			return true
		}
	}
	return false
}
